﻿using System;
using UnityEngine;

// Token: 0x02000383 RID: 899
[Serializable]
public class MeshLightMapData
{
	// Token: 0x06001642 RID: 5698 RVA: 0x000953B8 File Offset: 0x000935B8
	public void Record(Renderer renderer)
	{
		this.renderer = renderer;
		this.lightmapIndex = renderer.lightmapIndex;
		this.lightmapScaleOffset = renderer.lightmapScaleOffset;
	}

	// Token: 0x06001643 RID: 5699 RVA: 0x000953DC File Offset: 0x000935DC
	public void Apply(LightMapControl.LightTexSet[] sets)
	{
		this.renderer.lightmapIndex = this.lightmapIndex;
		this.renderer.lightmapScaleOffset = this.lightmapScaleOffset;
		if (this.lightmapIndex >= 0)
		{
			MaterialPropertyBlock materialPropertyBlock = new MaterialPropertyBlock();
			this.renderer.GetPropertyBlock(materialPropertyBlock);
			materialPropertyBlock.SetTexture("unity_Lightmap", sets[this.lightmapIndex].light);
			materialPropertyBlock.SetTexture("unity_LightmapInd", sets[this.lightmapIndex].dir);
			materialPropertyBlock.SetVector("unity_LightmapST", this.lightmapScaleOffset);
			this.renderer.SetPropertyBlock(materialPropertyBlock);
		}
	}

	// Token: 0x04001A00 RID: 6656
	public Renderer renderer;

	// Token: 0x04001A01 RID: 6657
	public int lightmapIndex = -1;

	// Token: 0x04001A02 RID: 6658
	public Vector4 lightmapScaleOffset;
}
